The present invention relates to sharing a physical device in a computing system, and more specifically to sharing a physical device across multiple virtual machines (e.g., logical partitions [LPAR]).
In paravirtualized environments, multiple virtual machines (e.g., LPARs) may use the same physical I/O device, such as a network adapter. The hypervisor may isolate virtual machines, allowing a single virtual machine to access the physical I/O device at a time. To allow each virtual machine to use the same physical I/O device, the hypervisor may present a virtual device to each virtual machine. When a virtual machine performs I/O operations on the virtual device, the hypervisor can intercept (and queue) I/O requests by the virtual machine and pass the requested commands to the physical I/O device. Generally, the hypervisor may have full ownership of the physical I/O device, and the virtual machines may not be able to directly access the physical I/O device or perform error recovery operations on the physical I/O device.
In some virtualized environments, a physical I/O device may allow multiple virtual machines to use the device concurrently through single root I/O virtualization (SR-IOV). In SR-IOV, a physical device may have physical functions (PFs) that allow for input/output and device configuration, as well as one or more virtual functions (VFs) that allow for data input/output. For example, an n-port network adapter may expose m VFs (e.g., one or more VF for each port) that may be used by the virtual machines hosted on a computing system. A hypervisor on the host computing system may interact with the physical I/O device using the PFs, while each can directly communicate with a portion of the physical I/O device using one or more VFs.
If VMs communicate and use physical I/O devices through a hypervisor, performance may be negatively impacted due to additional processing required at the hypervisor to move data and commands from the physical I/O device to the appropriate VM. In a virtualized environment where VMs use VFs exposed by an I/O device that supports SR-IOV, VMs may not be able to use all of the features supported by the I/O device.